Incorrect arguments for function (button)/ function(ok)

Hello,

I'm wondering if anyone can help me find the cause of an error message I'm getting when I try to run a DXL script. The script attached is a (very very) simple representation of what I'm trying to do (can't post work-related script!) and returns the exact same errors resulting from the "real" script.

 

The intention of the script is to

- open dialogue box

- press button btnStep1 to call function fnTest1 and return the value of b (to be shown in field dbeInput)

- press button btnStep2 to call function fnTest2 and close the dialog box. There is no output returned from fnTest2 in the "real" script, but it's a useful diagnostic in this simple test script to return the value of c.

 

The error message which occurs is as follows:

-E- DXL: <Line:27> incorrect arguments for function (button)
-E- DXL: <Line:33> incorrect arguments for function (ok)

 

I've read and re-read the 'DXL Reference Manual' definitions for button() and ok(), but no "lightbulb" moments. I've a suspicion that the error might be related to DB vs DBE in the callback in the button arguments, but I haven't enough experience to identify the problem properly or know how to solve it!

Any advice (or specific corrections to the portions of script related to the button/ok functions) would be greatly appreciated.

 

Cheers,

Karl

 

 

 

 


kdunlop - Wed Oct 23 11:43:49 EDT 2013

Re: Incorrect arguments for function (button)/ function(ok)
llandale - Wed Oct 23 13:24:45 EDT 2013

The "button" perm takes a function call, and that function MUST have exactly one parameter, a DBE and has no ..err.. void return value.  That is what this manual snip means:

  • DBE button(DB box, string label,void callback(DBE))          

The "ok" perm takes a callback function with a single "DB" parameter

  • DBE ok(DB box, [string label,]  void callback(DB))

I'm pretty sure your real dialog will have some DBE values "a" and "b"; and your callback functions would read ..err.. "get" the value from those DBEs and THEN do the calculation.

-Louie

Re: Incorrect arguments for function (button)/ function(ok)
kdunlop - Thu Oct 24 05:01:28 EDT 2013

llandale - Wed Oct 23 13:24:45 EDT 2013

The "button" perm takes a function call, and that function MUST have exactly one parameter, a DBE and has no ..err.. void return value.  That is what this manual snip means:

  • DBE button(DB box, string label,void callback(DBE))          

The "ok" perm takes a callback function with a single "DB" parameter

  • DBE ok(DB box, [string label,]  void callback(DB))

I'm pretty sure your real dialog will have some DBE values "a" and "b"; and your callback functions would read ..err.. "get" the value from those DBEs and THEN do the calculation.

-Louie

That really helps, thank you!